﻿<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ciuciu记事本</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body {
            width: 100%;
            height: 100%;
            background: linear-gradient(to right top,rgb(33, 8, 141),rgb(60, 2, 126));
        }
        .box {
            position: absolute;
            width: 1600px;
            background: linear-gradient(to right top,rgb(255, 230, 0),orange);
            padding: 50px;
            overflow: hidden;
        }
        ul {
            list-style: none;
        }
        .box h1 {
            text-align: right;
            padding-right: 10px;
            color: rgb(46, 46, 46);
            margin-bottom: 50px;
        }
        .box ul li {
            background:linear-gradient(to right top,#fff,rgb(253, 239, 199));
            padding: 20px 100px 20px 20px;
            /* width: 1600px; */
            /* height: 40px; */
            /* background-color: #fff; */
            font-size: 18px;
            position: relative;
            border: 2px solid rgb(255, 232, 156);
            /* box-shadow: 0px 2px 10px rgb(209, 164, 15); */
            transition: all .2s;
        }
        .box ul li:hover {
            position: relative;
            transform:translateY(-10px);
            box-shadow: 0px 6px 12px 4px rgba(65, 53, 16, 0.24);
        }
        .box ul li .text {
            display: block;
            /* background-color: #333; */
            font-size: 30px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            padding-left: 100px;
            font-weight: 500;
        }
        .box ul li .close{
            background-color: rgb(160, 32, 32);
            color: #fff;
            padding: 0 10px 0 10px;
            user-select: none;
            cursor: pointer;
            position: absolute;
            top: 25px;
            right: 30px;
        }
        .box ul li .index {
            display: block;
            position: absolute;
            top: 50%;
            padding: 0 10px 0 10px;
            background-color: #333;
            transform: translateY(-50%);
            border-radius: 20%;
            border: 2px solid #333;
            color: yellow;
        }
        .box input {
            position: relative;
            width: 1600px;
            height: 80px;
            outline: none;
            border: none;
            /* margin-bottom: 5px; */
            padding-left: 50px;
            padding-right: 120px;
            background-color: #333;
            color: rgb(250, 235, 19);
            font-size: 40px;
        }
        .box .enter {
            position: absolute;
            right: 95px;
            top: 167px;
            color: rgb(122, 122, 122);
            opacity: 1;
            z-index: 1;
            user-select: none;
        }
        .box .clear {
            /* display: block; */
            /* width: 100px; */
            /* height: 40px; */
            float: right;
            text-align: center;
            line-height: 40px;
            margin-top: 20px;
            margin-bottom: -20px;
            /* background-color: #fff; */
            cursor: pointer;
            user-select: none;
            font-size: 20px;
            transition: all .5s;
        }
        .box .clear:hover {
            transform:scale(1.1);
            text-decoration-line: underline;
            text-decoration-style: solid;
            /* box-shadow: 0px 6px 12px 4px rgba(65, 53, 16, 0.24); */
        }
        .box .top1,.box .top2,.box .top3 {
            position: absolute;
            width: 40px;
            height: 40px;
            border-radius: 50%;
        }
        .box .top1 {
            left: 50px;
            background-color: rgb(255, 136, 0);
        }
        .box .top2 {
            left: 100px;
            background-color: rgb(0, 128, 85);
        }
        .box .top3 {
            left: 150px;
            background-color: rgb(111, 0, 255);
        }
        .box .list-index {
            /* display: block; */
            /* width: 100px; */
            /* height: 40px; */
            float: left;
            text-align: center;
            line-height: 40px;
            margin-top: 20px;
            margin-bottom: -20px;
            /* background-color: #fff; */
            cursor: pointer;
            user-select: none;
            font-size: 20px;
            transition: all .5s;
        }
        .node {
            position: absolute;
            transform: scale(0.5);
            left: 18%;
            top: 36%;
            /* transform: translate(-50%,-50%); */
        }
    </style>
</head>
<body>
    <div class="node">
        <div class="box">
            <div class="top1"></div>
            <div class="top2"></div>
            <div class="top3"></div>
            <span class="enter">Enter</span>
            <h1>^ ciuciu记事本|可肆意拖拽</h1>
            <input type="text" placeholder="请在这里输入你的标签" class="box-input" v-model="thisValue" v-on:keyup.enter="add">
            <ul>
                <li v-for="(item,index) in texts">
                    <span class="index">{{index+1}}</span>
                    <span class="text">{{item}}</span>
                    <span class="close" @click="sub(index)">×</span>
                </li>
            </ul>
            <span class="list-index">总共有 {{texts.length}} 个标签</span>
            <span class="clear" v-show="vshow" @click = "clearAll">clear</span>
        </div>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const nodeBook = new Vue({
        el:".box",
        data:{
            message:"666",
            thisValue:'',
            texts:['ciuciu云网络','21世纪权代壹网络科技'],
            vshow:true,
        },
        methods:{
            add:function(){
                if(this.thisValue == '' || this.thisValue.trim() == ''){
                    this.texts.push("空内容");
                    this.thisValue = "";
                }else {
                    this.texts.push(this.thisValue);
                    this.thisValue = "";
                }
            },
            sub:function(index){
                this.texts.splice(index,1);
            },
            clearAll:function(){
                this.texts = [];
                vshow = false;
            }
        }
    });
</script>
<script>
    var node = document.querySelector(".node");
    node.onmousedown = function(event){
        var ox = event.clientX - node.offsetLeft;
        var oy = event.clientY - node.offsetTop;
        document.onmousemove = function(event){
            let x = event.clientX-ox;
            let y = event.clientY-oy;
            node.style.left = x+"px";
            node.style.top = y+"px";
            return false;
        }
        document.onmouseup = function(){
            document.onmousemove = null;
        }
    }
</script>
<script type="text/javascript">
</script>
</html>